<template>
	<view style="height: 100%;">
		<view class="centent">
				<view class="navtopbox" >
					<view class="navtopboxcenter">
						<scroll-view scroll-y="true" style="height:100% ;">
							<view class="navlist" @tap="toschoolxiangqing(item.id)" v-for="(item,index) in gglist" :key = "index"  v-if="gglist.length>0" >
								<view class="title">
									<text>【</text>
									<text>{{item.newsname}}</text>
									<text>】</text>
									
								</view>
								<view class="jianyao">
									<text>{{item.summary}}</text>
								</view>
								<view class="time">
									<text>{{item.time}}</text>
								</view>
								<view class="tojiantou">
									<image src="../../static/jiantou.png" mode=""></image>
								</view>
							</view>
							<kongyemian v-if="gglist.length<1" :isLoding="loding"></kongyemian>
						</scroll-view>
						
					</view>
				</view>
		</view>
		
	</view>
</template>

<script>
	import {
		mapState,
		mapGetters,
		mapMutation,
		mapActions
	} from 'vuex';
	export default {
		computed: {
			...mapState({
				userInfo: state => state.user.userInfo,				
				isLogin: state => state.user.isLogin
			})
		},
		data() {
			return {
				schoollist:0,
				gglist:[],
				loding:true
			}
		},
		methods: {
			
			
			schoollistshow() {
				this.loding = true
				this.$store
					.dispatch('schoollist', {
						token: this.userInfo.token,
						school_id: this.school_id
			
					})
					.then(res => {							
						this.gglist = res.data.data;							
						this.loding = false
					});
			},
			toschoolxiangqing(id){
				uni.navigateTo({
					url:'../ggxiangqing/ggxiangqing?id='+id
				})
			}
		},
		onLoad(data) {
			this.school_id = data.school_id
			this.schoollistshow()
		},
		onPullDownRefresh() {
			this.schoollistshow()
			setTimeout(() => {
				uni.stopPullDownRefresh();
			}, 1500)
		}
	}
</script>

<style lang="less">
	page{
		height: 100%;
		background-color: #f4f4f4;
		box-sizing: border-box;
		
	}
.centent {
		background-image: url(../../static/keding.png);
		background-size: 100% auto;
		background-repeat: no-repeat;
		width: 100%;
		height: 100%;		
		.navtopbox{
			width: 100%;
			height: 100%;
			// background-color: #222222;
			padding: 20rpx;
			box-sizing: border-box;
			.navtopboxcenter{
				width: 100%;
				height: 100%;
				background-color: #fff;
				box-shadow: 0rpx 4rpx 17rpx 4rpx rgba(201, 202, 208, 0.35);
				border-radius: 15rpx;
				overflow: hidden;
				.navlist{
					position: relative;
					width: 100%;
					min-height: 200rpx;
					border-bottom: 2rpx solid #ccc;
					padding: 20rpx 40rpx 20rpx 20rpx;
					box-sizing: border-box;
					display: flex;
					flex-direction: column;
					justify-content: space-evenly;
					.title{
						font-size: 32rpx;
						font-weight: bold;
						
					}
					.jianyao{
						font-size: 24rpx;
						
					}
						
					
					.time{
						font-size: 24rpx;
						color: #999999;
					}
					.tojiantou{
						position: absolute;
						right: 13rpx;
						image{
							width: 27rpx;
							height: 45rpx;
						}
					}
				}
			}
		}

		
	}
</style>
